
<script setup>
import { reactive, toRefs } from "vue";
import { useRoute } from "vue-router";
import MyDatails from "../../components/MyDatails.vue";
import { getSearchClassifyCourse } from "../../http/http";
import MyRecommendCourse from "../../components/MyRecommendCourse.vue";
const route = useRoute();
// 数据类型
const data = reactive({
  SearchClassifyCourse: [],
});
// 接收id
const id = route.query.classify_id;
// 免费直播课
const FngetSearchClassifyCourse = async () => {
  let res = await getSearchClassifyCourse(id);
  data.SearchClassifyCourse = res.data.filter((ele) => ele.price == 0);
};
// 调用封装数据
FngetSearchClassifyCourse();
// 解构出数据
const { SearchClassifyCourse } = toRefs(data);
</script>
<template>
  <div class="live">
    <!-- 头部 -->
    <MyDatails>
      <template #left>
        <van-icon name="arrow-left" @click="$router.back" />
      </template>
      <template #text>
        <h3>免费直播课</h3>
      </template>
    </MyDatails>
    <!-- 课程列表 -->
    <MyRecommendCourse :RecommendCourseList="SearchClassifyCourse">
    </MyRecommendCourse>
  </div>
</template>

<style lang="scss" scoped>
</style>